package org.example.myleet.p590;

import org.example.myleet.Utils.Assert;
import org.example.myleet.Utils.JsonUtils;
import org.example.myleet.Utils.Parser;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue("[5,6,3,2,4,1]".equals(JsonUtils.toJson(solution.postorder(Parser.parseNChildrenTree(new Integer[]{1,null,3,2,4,null,5,6})))));
        Assert.isTrue("[2,6,14,11,7,3,12,8,4,13,9,10,5,1]".equals(JsonUtils.toJson(solution.postorder(Parser.parseNChildrenTree(new Integer[]{1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14})))));
        Assert.isTrue("[]".equals(JsonUtils.toJson(solution.postorder(Parser.parseNChildrenTree(new Integer[]{})))));
    }
}
